<!--

Version 0.1
SEMF - Web Desiging Framework for Sport Event Managment
Copyright (C) 2006, SEMF Developers

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

-->

<?php
header('Cache-control: no-cache');
$semf_root = '../';
$page_xml = $_GET["page_xml"];
$result_dir = $_GET["result_dir"];
$project_home = $_GET["project_home"];
$user_token = $_GET['user_token'];

$module_name = $_GET["module_name"];

$plugin_comp = $_GET["plugin_comp"];
$plugin_param = $_GET["plugin_param"];
$plugin_return = $_GET["plugin_return"];

$page_name = basename($page_xml);
$page_name = substr($page_name, 0, strlen($page_name)-4);
//for the testing purposes..
if(!isset($page_xml))
{
	$page_xml = "./tests/page.xml";
	$result_dir = "./tests/";
	$project_home = "../projects/";
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="docHead">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Cache-control" content="no-cache" />
<title>SEMF Page Designer - <?php echo $page_name; ?></title>
<!-- includign yui scripts -->
<script language="javascript" src="../yui/yahoo.js"></script>
<script language="javascript" src="../yui/animation.js"></script>
<script language="javascript" src="../yui/dom.js"></script>
<script language="javascript" src="../yui/event.js"></script>
<script language="javascript" src="../yui/container.js"></script>
<script language="javascript" src="../yui/container_core.js"></script>
<script language="javascript" src="../yui/dragdrop.js"></script>
<script language="javascript" src="../yui/connection.js"></script>
<script language="javascript" src="../yui/treeview.js"></script>
<script language="javascript" src="../yui/ResizePanel.js"></script>

<!--tigra-->

<script language="javascript" src="../bin/tigra/picker.js"></script>

<!-- including semf scripts -->
<script language="javascript" src="../bin/SEMF.js"></script>
<script language="javascript" src="../bin/util.js"></script>
<script language="javascript" src="../bin/ajax.js"></script>
<script language="javascript" src="../bin/tab.js"></script>
<script language="javascript" src="bin/pageDesigner.js"></script>
<script language="javascript" src="bin/layouting.js"></script>
<script language="javascript" src="bin/DDPlayer.js"></script>
<script language="javascript" src="bin/components.js"></script>

<!-- including tinyMCE and its configurations -->
<!--<script language="javascript" src="../bin/tiny_mce/tiny_mce.js"></script>
<script language="javascript" src="bin/TinyMCE.js"></script> -->

<script language="javascript">

SEMF.pageDesigner.init = function()
{
	SEMF.pageDesigner.initLayers();
	SEMF.pageDesigner.initPanels();
	SEMF.pageDesigner.initPluginComps();
	SEMF.pageDesigner.initComponents();
	SEMF.pageDesigner.initStatusTab();
	SEMF.pageDesigner.initDesignerComponent();
	SEMF.pageDesigner.initToolBar();
	SEMF.pageDesigner.initStore();
	SEMF.pageDesigner.initOpenSave();
}
</script>
<link href="../styles/layout.css" rel="stylesheet" type="text/css" />
<link href="../styles/container.css" rel="stylesheet" type="text/css" />
<link href="../styles/tree.css" rel="stylesheet" type="text/css" />
<link href="../styles/tab.css" rel="stylesheet" type="text/css" />
<link href="../bin/dp/dpSyntaxHighlighter.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="../icons/semf.ico" />

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>

<!-- placement of the components, designer and properties -->
<div style="overflow:auto" id="designerPanel"></div>
<div id="componentsPanel"></div>
<div id="hideComponentsBtn">
<img id="hideComponentsImg" onclick="SEMF.pageDesigner.hideShowComponents()" src="../icons/symb11x11-11-.gif"
  onmouseover="SEMF.pageDesigner.rolloverEffect(this)" onmouseout="SEMF.pageDesigner.rolloverEffect(this)"  />
</div>
<div id="propertiesPanel">
<!--<input style="width:150px; height:25px" type="text" value="something" />-->
</div>
<div id="hidePropertiesBtn">
<img id="hidePropertiesImg" onclick="SEMF.pageDesigner.hideShowProperties()" src="../icons/symb11x11-13-.gif"
 onmouseover="SEMF.pageDesigner.rolloverEffect(this)" onmouseout="SEMF.pageDesigner.rolloverEffect(this)"/>
</div>

<div id="toolBar" style="left:250px">
	<div class="left">
		<div class="bottombody">
			<div class="blthin">
				<div id="toolBarInner">
					<div style="float:left; width:20px">
						&nbsp;
					</div>
					<div class="toolBarButton">
						<img title="Back" src="images/toolbar/back.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Open" src="images/toolbar/open.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Save" src="images/toolbar/save.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Undo" src="images/toolbar/undo.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Redo" src="images/toolbar/redo.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Delete" src="images/toolbar/delete.gif"></img>
					</div>
					
					<div class="middle_sep" style="float:left; width:20px; height:36px">
						&nbsp; <!-- seperator -->
					</div>
					
					<div class="toolBarButton">
						<img title="Media" src="images/toolbar/media.gif"></img>
					</div>
					
					<div class="toolBarButton">
						<img title="Properties" src="images/toolbar/properties.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Components" src="images/toolbar/components.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Generate" src="images/toolbar/generate.gif"></img>
					</div>
					<div class="toolBarButton">
						<img title="Preview" src="images/toolbar/play.gif"></img>
					</div>
					
					<div class="middle_sep"  style="float:left; width:20px; height:36px">
						&nbsp; <!-- seperator -->
					</div>
					<div class="toolBarButton">
						<img title="Help" src="images/toolbar/help.gif"></img>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="currentStatusPanel">
<div class="hd">Current Status</div>
<div id="currentStatusTab" class="bd">

</div>
<div class="ft"></div>
</div>
	<!--<div id="currentStatusView">
	</div>-->

<div id="componenentsSelectorPanel">
<div class="hd">Component Selector</div>
<div class="bd" id="componentSelector">
<?php
include("component_viewer.php");
?>
</div>
<div class="ft"></div>
</div>


<div id="propertiesViewerPanel">
<div class="hd">Properties</div>
<div id="propertiesView" class="bd" style="position:absolute; overflow:auto">
</div>
<div class="ft"></div>
</div>

<div style="visibility:hidden" id="componentMarker">
</div>

<div id="alertPanel">
<div id="compilerHeader" class="hd">Message</div>
<div id="compilerView" class="bd" style="width: 100%; position:absolute; overflow:auto">
WHatever here <br/>

</div>
<div class="ft"></div>
</div>

<div id="propertyExpanderPanel">
<div id="propertyExpanderHeader" class="hd">PropertyExpander</div>
<div id="propertyExpanderView" class="bd" style="width: 100%; position:absolute; overflow:auto">

</div>
<div class="ft"></div>
</div>

<div id="propertyExtenderType1" style="visibility:hidden">
<textarea id="propertyExtenderType1Value" style="width:98%; height:260px" name="textarea">
</textarea>
</div>

<div id="propertyExtenderType2" style="visibility:hidden">
<!--<iframe style="border:none; height:260px; overflow:visible" 
	width="100%" src="RichText.html">
</iframe>-->
</div>

<div id="hiddenStatusTabs" style="visibility:hidden; position:absolute; top:0px; height:50px; overflow:hidden;">
<div style="visibility:hidden; position:absolute" id='currentStatusView'></div>
<div style="position:absolute" id='currentTablesView'></div>
<div style="position:absolute" id='currentPagesView'></div>
</div>

<div id="storePanel" style="visibility:visible">
<div id="storePanelHeader" class="hd">Library..</div>
<div id="storePanelView" class="bd" style=" width:98% position:absolute;" >
	<iframe id="storePanelFrame" style="border:none;width:100%; height:340px; overflow:auto" src="store_list.php">
	</iframe>
</div>
<div id="storePanelFooter" class="ft"></div>
</div>

<div id="openSavePanel" style="visibility:visible">
<div id="openSavePanelHeader" class="hd">Open/Save..</div>
<div id="openSavePanelView" class="bd" style="width:98% position:absolute;" >
	<iframe id="openSavePanelFrame" style="border:none;width:100%; height:340px; overflow:auto" src="open_save.php">
	</iframe>
</div>
<div id="openSavePanelFooter" class="ft"></div>
</div>

<div id="propertyExtenderType1" style="visibility:hidden; position:absolute">
<textarea id="propertyExtenderType1Value" style="width:98%; height:260px" name="textarea">
</textarea>
</div>
<div id="pageLogo">
<img src="images/sys/page_designer.gif" />
</div>


<script language="javascript">

<?php
echo <<<END1
SEMF.pageDesigner.pageInfo["pageXML"] = "$page_xml";
SEMF.pageDesigner.pageInfo["resultDir"] = "$result_dir";
SEMF.pageDesigner.pageInfo["projectHome"] = "$project_home";
END1;
if(isset($plugin_comp) && $plugin_comp != "")
{
	echo <<<END1
	SEMF.pageDesigner.pageInfo["pluginComp"] = "$plugin_comp";
	SEMF.pageDesigner.pageInfo["pluginParam"] = "$plugin_param";
	SEMF.pageDesigner.pageInfo["pluginReturn"] = "$plugin_return";
END1;
}
?>

SEMF.pageDesigner.pageInfo["semfRoot"] = "../";
SEMF.pageDesigner.init();

</script>

<!-- This is a place holder for the last script -->
<script id="theLastScript">
</script>

<form id="back2Schema"
	 method="post" action="../project_home/index.php">
<input type="hidden" name="module_name" id="module_name_input"
		 value="<?php echo $module_name; ?>" />
<input type="hidden" name="project_dir" id="project_home_input"
		 value="<?php echo $project_home; ?>" />
<input type="hidden" name="user_token" id="user_token_input"
		 value="<?php echo $user_token; ?>" />
<input type="hidden" name="from_page_designer" value="1" />
</form>

</body>
</html>
